local yuekuang = fk.CreateSkill {
  name = "th_yuekuang",
}

yuekuang:addEffect("filter", {
  name = "th_yuekuang",
  card_filter = function(self, card, player)
    return player:hasSkill(yuekuang.name) and (card.type == Card.TypeBasic or card.type == Card.TypeTrick) and not table.contains(player:getCardIds("j"), card.id)
  end,
  view_as = function(self, player, card)
    local name = card.type == Card.TypeBasic and "slash" or "duel"
    local to = Fk:cloneCard(name, card.suit, card.number)
    return to
  end
})

yuekuang:addTest(function(room, me)
  FkTest.RunAddSkills(me, yuekuang.name)

  --- test: 视为技只要判是否能顺利视为就行
  FkTest.runInRoom(function ()
    room:obtainCard(me, room:printCard("peach"))
    room:obtainCard(me, room:printCard("snatch"))
  end)

  local handcards = me:getCardIds("h")
  lu.assertEquals(Fk:getCardById(handcards[1]).name, "slash")
  lu.assertEquals(Fk:getCardById(handcards[2]).name, "duel")
end)

Fk:loadTranslationTable{
  ["th_yuekuang"] = "月狂",
  [":th_yuekuang"] = "锁定技，你的基本牌视为【杀】，锦囊牌视为【决斗】。",
}

return yuekuang